﻿#include <iostream>
using namespace std;

int main() {
	int x = 125, y = 250, sw;

	cout << "x=" << x << ",y=" << y << '\n';

	cout << "选择修改x或y（0：x，1：y）："; cin >> sw;

	int* ptr;

	if (sw) {
		ptr = &y;
	}
	else {
		ptr = &x;
	}

	*ptr = 999;

	cout << "x=" << x << ",y=" << y << '\n';

	cin.get();
	cin.get();
}